{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from beakerx import *\n",
    "from beakerx.object import beakerx\n",
    "\n",
    "import pandas as pd\n",
    "df = pd.read_csv('../resources/data/interest-rates-small-with_index.csv')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from beakerx import *\n",
    "from beakerx.object import beakerx\n",
    "\n",
    "import pandas as pd\n",
    "df = pd.read_csv('../resources/data/interest-rates-small-with_index.csv',index_col=0)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from beakerx import *\n",
    "from beakerx.object import beakerx\n",
    "\n",
    "import pandas as pd\n",
    "\n",
    "s1 = pd.Series([0, 1, 2], index=pd.date_range('2000', freq='D', periods=3))\n",
    "s2 = pd.Series([3, 4, 5], index=pd.date_range('2000', freq='D', periods=3))\n",
    "s3 = pd.Series([6, 7, 8], index=pd.date_range('2000', freq='D', periods=3))\n",
    "\n",
    "df = pd.concat([s1, s2, s3], axis=1)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from beakerx import *\n",
    "from beakerx.object import beakerx\n",
    "\n",
    "import pandas as pd\n",
    "\n",
    "s1 = pd.Series([0, 1, 2], index=pd.date_range('2000', freq='D', periods=3))\n",
    "s2 = pd.Series([3, 4, 5], index=pd.date_range('2000', freq='D', periods=3))\n",
    "s3 = pd.Series([6, 7, 8], index=pd.date_range('2000', freq='D', periods=3))\n",
    "\n",
    "df = pd.concat([s1, s2, s3], axis=1)\n",
    "\n",
    "def color_provider(row, column, table):\n",
    "    row = table.values[row]\n",
    "    val = row[column]\n",
    "    if val == 4:\n",
    "        return Color.GREEN\n",
    "    return Color.BLACK\n",
    "    \n",
    "table = TableDisplay(df)\n",
    "table.setStringFormatForTimes(TimeUnit.DAYS)\n",
    "table.setFontColorProvider(color_provider)\n",
    "\n",
    "table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": false,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": false,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
